// 导入Vue
import { render, createVNode, createApp } from 'vue'
// import '@/styles/element-variables.scss';
import uploadFromComponent from './index.vue';

const uploadFrom = {};
uploadFrom.install = function () {
  // 在 Vue 应用创建之前，添加全局方法
  const instance = createVNode(uploadFromComponent)

  // 生成一个该子类的实例
  const container = document.createElement('div');
  render(instance, document.createElement('div'))
  document.body.appendChild(container);

  // 假设我们有一个方法叫做 `upload`，它可能是一个用于处理上传逻辑的函数。
  function upload(callback, isMore, modelName, boo) {
    instance.visible = true;
    instance.callback = callback;
    instance.isMore = isMore;
    instance.modelName = modelName;
    instance.booleanVal = boolean;
  }

  // 在 Vue 应用创建之前，添加全局方法
  const app = createApp();
  app.config.globalProperties.$modalUpload = upload;
};

export default uploadFrom;
